home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / ViewCell / ViewCell.cp < prev    next >
Text File  |  2000-06-23  |  1KB  |  64 lines

  1. // ViewCell.cp
  2.  
  3. #ifndef ViewCell_h
  4. #include "ViewCell.h"
  5. #endif
  6. #ifndef CursorObject_h
  7. #include "CursorObject.h"
  8. #endif
  9. #ifndef CellVisitor_h
  10. #include "CellVisitor.h"
  11. #endif
  12. #ifndef Canvas_h
  13. #include "Canvas.h"
  14. #endif
  15.  
  16. void ViewCell::Deliver( CellVisitor& visitor, const Canvas& canvas )
  17.   {
  18.     Assert( visitor.Destination().Intersects( canvas.OnScreen() ) );
  19.     visitor.Visit( *this, canvas );
  20.   }
  21.  
  22. void ViewCell::Click( const Canvas&,
  23.                              const MouseDownEvent& )
  24.   {
  25.   }
  26.  
  27. void ViewCell::ActivatingClick( const Canvas&,
  28.                                           const MouseDownEvent& )
  29.   {
  30.   }
  31.  
  32. const CursorObject& ViewCell::Cursor( const Canvas&,
  33.                                                   const MouseEvent&,
  34.                                                   RegionObject& ) const
  35.   {
  36.     return CursorObject::Arrow();
  37.   }
  38.  
  39. ViewCell& ViewCell::Blank()
  40.   {
  41.     class BlankCell: virtual public ViewCell
  42.       {
  43.         public:
  44.             virtual void Draw( const Canvas& canvas ) const
  45.                 { EraseRect( &canvas.OnScreen() ); }
  46.       };
  47.     
  48.     static BlankCell blank;
  49.     return blank;
  50.   }
  51.  
  52. ViewCell& ViewCell::Black()
  53.   {
  54.     class BlackCell: virtual public ViewCell
  55.       {
  56.         public:
  57.             virtual void Draw( const Canvas& canvas ) const
  58.                 { PaintRect( &canvas.OnScreen() ); }
  59.       };
  60.     
  61.     static BlackCell black;
  62.     return black;
  63.   }
  64.